home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Libraries / stdwin / Appls / dpv / dpvdoc.h < prev    next >
Encoding:
Text File  |  1989-03-21  |  2.4 KB  |  63 lines  |  [TEXT/????]

  1. /* dpv -- ditroff previewer.  Description of input language. */
  2.  
  3. /* This isn't really a source file but disguised as one it is
  4.    more likely to be distributed with the rest of the source */
  5.  
  6. /******************************************************************************
  7.  
  8.     output language from ditroff:
  9.     all numbers are character strings
  10.     
  11.     (These comments should suffice to write my own ditroff output
  12.     filter, but I'm lazy...  Note that the parser expects its input to
  13.     be error-free -- it contains unchecked fscanf calls all over.
  14.     Also it is not clear whether relative motions may have negative
  15.     numbers as parameters.  For filters descending from BWK's prototype
  16.     this works for 'v' but not for 'h', as 'v' uses fscan but 'h'
  17.     reads characters until it finds a non-digit...  GvR)
  18.  
  19. {    push environment (font, size, position)
  20. }    pop environment
  21. #..\n    comment
  22. sn    size in points
  23. fn    font as number from 1 to n
  24. cx    ascii character x
  25. Cxyz    funny char \(xyz. terminated by white space
  26. Hn    go to absolute horizontal position n
  27. Vn    go to absolute vertical position n (down is positive)
  28. hn    go n units horizontally (relative)
  29. vn    ditto vertically
  30. nnc    move right nn, then print c (exactly 2 digits!)
  31.         (this wart is an optimization that shrinks output file size
  32.          about 35% and run-time about 15% while preserving ascii-ness)
  33. pn    new page begins (number n) -- set v to 0
  34. P    spread ends -- output it. (Put in by vsort).
  35. nb a    end of line (information only -- no action needed)
  36.     b = space before line, a = after
  37. w    paddable word space -- no action needed
  38.  
  39. Dt ..\n    draw operation 't':
  40.     Dl x y        line from here by x,y (drawing char .)
  41.             (affects position by x, y -- GvR)
  42.     Dc d        circle of diameter d with left side here
  43.     De x y        ellipse of axes x,y with left side here
  44.     Da x y x1 y1    arc; see drawarc in dpvoutput.c for description
  45.     D~ x y x y ...    B-spline curve by x,y then x,y ...
  46.  
  47. x ..\n    device control functions:
  48.      x i    init
  49.      x T s    name of device is s
  50.      x r n h v    resolution is n/inch h = min horizontal motion, v = min vert
  51.      x p    pause (can restart)
  52.      x s    stop -- done for ever
  53.      x t    generate trailer
  54.      x f n s    font position n contains font s
  55.              (there appears to be some disagreement whether this also
  56.              selects s as the current font -- GvR)
  57.      x H n    set character height to n
  58.      x S n    set slant to N
  59.  
  60.     Subcommands like "i" are often spelled out like "init".
  61.  
  62. ******************************************************************************/
  63.